function course(tbl){
	var course=$fetch("course",Cnd.where("id","=",tbl.id))
	course.put("teachers",$list("teacher",Cnd.where("name","in",java.util.Arrays.asList(course.teacher.split(",")))))
	course.put("comments",$list("comment",Cnd.where("tbl_name","=","course").and("tbl_id","in",tbl.id)))
	var agency=$fetch("agency","id="+course.agency_id);
	agency.put("course_num",$count("course",Cnd.where("agency_id","=",agency.id)))
	agency.put("user_num",$count("orders",Cnd.where("agency_id","=",agency.id)))
	course.put("agency",agency)
	var chapters=$list("chapter","tbl_name='course' and tbl_id ="+tbl.id+" and pid = 0")
	chapters.forEach(function(c){
		c.put("list",$list("chapter","tbl_name='course' and tbl_id ="+tbl.id+" and pid = "+c.id))
	})
	var chapter=$fetch("chapter","tbl_name='course' and tbl_id ="+tbl.id+" and (type = 'video' or type = 'zb') ")
	course.put("chapters",chapters)
	course.put("chapter",chapter)
	var combo=$fetch("combo",Cnd.where("course","like","%"+course.id+"%"))
	if(!isEmpty(combo)){
	combo.put("list",$list("course",Cnd.where("id","in",combo.course)))
	attr("combo",combo)
	}
	var play=0;//未登录不可播放 去报名
	if(user()!=null){
		var order=$fetch("orders","user_id="+user().id+" and status=1 and ( (tbl_name='course' and tbl_id ="+tbl.id+") or (tbl_name='combo' and tbl_like like '%"+tbl.id+",%') )")
		if(order!=null){//有该视频可以播放
			play=1;
		}else{
				if(course.price>0){
					if(course.type=="独家"){
						play=2;//去付款
					}else if(user().vip>1){
						play=0;
					}else{
						play=0;//去付款
					}
				}else{
					if(user().vip>=course.vip){
						play=0;//去报名
					}else if(course.vip==1){
						play=3;//购买VIP
					}else{
						play=0;//去报名
					}
				}
		}
	}
	attr("play",play)
	var courses=$list("course",Cnd.where("0","=",0),1,5)
	attr("courses",courses)
	if(!isEmpty(tbl.uid)){
		var u=$fetch("users",Cnd.where("id","=",tbl.uid))
		attr("u",u)
	}
	return course;
}